package lab03.test11;

import java.sql.*;

public class Test {
    public static void main(String[] args) {
        Connection connection=null;
        Statement statement=null;
        ResultSet resultSet=null;
        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        try {
            connection= DriverManager.getConnection("jdbc:mysql://localhost:3306/java_2017?serverTimezone=UTC","root","123456");
            statement=connection.createStatement();
            statement.executeUpdate("INSERT INTO t_users(id,username,password,register_datetime)VALUES (1,'admin','admin',192312312123)");
            statement.executeUpdate("INSERT INTO t_users(id,username,password,register_datetime)VALUES (2,'chen','12346',123123213123)");
        } catch (SQLException e) {
            e.printStackTrace();
        } finally {
            try {
                connection.close();
                statement.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }

        }
    }
}

